from fastapi import FastAPI
from starlette.middleware.cors import CORSMiddleware

from apps.app01 import app01
from apps.app02 import app02
from apps.app03 import app03

app = FastAPI()

# 解决跨域请求问题
app.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],  # 生产环境应指定具体域名
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

app.include_router(app01,tags=['01 入门案例'])
app.include_router(app02,tags=['02 get请求案例'])
app.include_router(app03,tags=['03 post请求案例'])


